package com.efesco.finance.oughtReceive;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.efesco.common.Tools;
import com.efesco.system.User;

/**
 * paymentGroupViewModel
 */
public class paymentGroupViewModel extends DefaultViewModel {
	public void deleteGroup(ParameterSet parameters) throws Exception {
		Dataset paymentGroupdataset = getDataset("paymentGroupdataset");
		String groupId = Tools.toStr(paymentGroupdataset.getString("PAYMENT_GROUP_ID"));
		
		if (!groupId.equals(""))  {
			DBStatement statement = new DBStatement();
			statement.setSql("delete from s_payment_group_employee ge where ge.payment_group_id="+groupId);
			statement.execute();
	        statement.close();
	        statement.setSql("delete from s_payment_group where payment_group_id="+groupId);
			statement.execute();
	        statement.close();
		}
	}
}
